<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/8/14
  Time: 9:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <center>
        <table border="1" rules="all">
            <tr align="center" bgcolor="aqua">
                <td>学生编号</td>
                <td>学生姓名</td>
                <td>家庭住址</td>
                <td>班级</td>
                <td colspan="3"><a><button>新增学生</button></a></td>
            </tr>
            <c:forEach var="s" items="${list}" varStatus="a">
                <tr align="center" bgcolor="${a.index%2==0?'pink':''}">
                    <td>${s.id}</td>
                    <td>${s.sname}</td>
                    <td>${s.address}</td>
                    <td>
                        <a href="#" onclick="ckbj('${s.gb.gid}')">${s.gb.gname}</a>
                    </td>
                    <td>
                        <a><button>删除</button></a>
                        <a><button>修改</button></a>
                        <a><button onclick="xsxzbj('${s.id}')">学生选择班级</button></a>
                    </td>
                </tr>
            </c:forEach>
            <tr align="right">
                <td colspan="100">
                    <a href="<c:url value='/getStuExcel.do'/>">导出</a>
                    <a href="<c:url value='/toExcelImport.do'/>">导入</a>
                    <a href="<c:url value='/getStuPDF.do'/>">导出PDF</a>
                </td>
            </tr>
        </table>

    </center>
</body>
<script>
    function xsxzbj(id) {
        location.href="<c:url value='/toStuGrade.do?id='/>"+id;
    }
</script>
<script>
    function ckbj(gid) {
        window.open("<c:url value='/getGradeByGid.do?gid='/>"+gid,"","heigt=400px,width=600px")
    }
</script>
</html>
